package com.xiaolaoyiguan.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xiaolaoyiguan.dao.HomeDao;
import com.xiaolaoyiguan.entity.Article;

/**
 * service实现类
 * @author Administrator
 *
 */

@Service
public class HomeServiceImpl implements HomeService {
    
	@Resource
	private HomeDao homeDao;
	public HomeDao getHomeDao() {
		return homeDao;
	}

	public void setHomeDao(HomeDao homeDao) {
		this.homeDao = homeDao;
	}

	public List<Article> getAll() {
		
		return homeDao.listAll();
	}

	public Object findAtricleById(String id) {
		// TODO Auto-generated method stub
		return homeDao.findById(id);
	}

	public void add(Article art) {
		// TODO Auto-generated method stub
		homeDao.save(art);
	}

	public void edit(Article art) {
		// TODO Auto-generated method stub
		homeDao.update(art);
	}

}
